#include<stdio.h>
int main()
{
    int n, k;
    scanf("%d %d", &n, &k);
    int a = 0, b = 0;
    double sum1 = 0, sum2 = 0;
    for(int i = 1; i <= n; i ++)
    {
        if(i % k == 0)
        {
            a ++;
            sum1 += i;
        }
        else
        {
            b ++;
            sum2 += i;
        }
    }

    printf("%.1f %.1f\n", sum1 / a, sum2 / b);
    return 0;
}